Repository navigation
Add Viva.com driver - #34
Merged
Merged
Conversation
Viva.com is a Greek acquirer with a wide European footprint, on Smart
Checkout:
- createPayment() takes an OAuth2 client-credentials token from the
accounts host, creates the payment order and returns the documented
?ref={OrderCode} checkout url, keeping the 16-digit order code a string.
- Webhooks are signed over the raw body: Viva-Signature-256 is the hex
HMAC-SHA-256 under the webhook secret, Viva-Signature the SHA-1 one.
- Only the documented events are read, the event and the transaction's own
StatusId have to agree, and F is the only status treated as money.
- Refunds are not wrapped: Viva documents them on a separate surface.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this adds
Tahseel::gateway('viva')- a Greek acquirer with a wide European footprint, on Smart Checkout.createPayment()- OAuth2 client-credentials token from the accounts host (grant_type=client_credentials, client id/secret as Basic), thenPOST /checkout/v2/orderson the API host with minor-unit amounts and the 4-digit payment source. The 16-digit order code is kept a string (Viva's docs are explicit: a JS number cannot hold it) and becomes the documentedhttps://www.vivapayments.com/web/checkout?ref={OrderCode}url.verifyAndParseWebhook()-Viva-Signature-256is the hex HMAC-SHA-256 of the raw body under the webhook secret,Viva-Signaturethe SHA-1 equivalent; the driver prefers the 256 header, falls back to the 1 one, compares in constant time, and refuses a body whose raw bytes it cannot see. Only the documented events are read (1796 payment created, 1797 reversal, 1798 payment failed, 4865 order updated), and the event and the transaction's ownStatusIdhave to agree - a notification claiming success for a failed transaction is refused, not believed.Fpaid,A/Cpending,Rrefunded,E/Xfailed, anything else refused. Amounts arrive in minor units with the currency as an ISO numeric code (978= EUR), mapped beforeMoney.Honesty notes
OrderCodeplusTransactionId,StatusIdandAmount, which the driver checks, and that is what it relies on.Metadata
README (EN) +
docs/ar/README.mdin sync (count 23 → 24, driver table, full## Viva.comsection), CHANGELOG [Unreleased],composer.jsondescription + keywords (viva,vivawallet,smart checkout), config block +VIVA_*env vars, every optional extra off by default.Tests
13 fixture tests. Suite 622 passed / 1477 assertions, PHPStan level 8 clean, Pint clean.